package com.devshephard.framework.ApplicationController;


import com.devshephard.business.service.UpdateUserInfo;
import com.devshephard.business.service.impl.UpdateUserInfoImpl;
import com.devshephard.mapper.IUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@RestController
public class ApplicationController {


    @Autowired
    UpdateUserInfoImpl updateUserInfo;

    @RequestMapping("/")
    @ResponseBody
    public String rootController(HttpServletRequest request){
        System.out.println(request.getRequestURI());
        System.out.println("访问根路径");
        return "index";
    }

    @RequestMapping("/setSession")
    @ResponseBody
    public String setSession(HttpSession httpSession){
        httpSession.setAttribute("session","devshephard");
        System.out.println("访问setSessionController");
        return "session";
    }

    @RequestMapping("/getSession")
    @ResponseBody
    public String getSession(HttpSession httpSession){
        System.out.println("访问getSessionController");
        return "session";
    }

}
